{% extends "base.html" %}

{% block content %}
<div class="container-fluid">
    <div class="card">
        <div class="card-header">
            <h5 class="mb-0"><i class="fas fa-tools me-2"></i>添加维护记录</h5>
        </div>
        <div class="card-body">
            <form method="POST" action="{{ url_for('network.maintenance_add', pipe_id=pipe.id) }}">
                <div class="row g-3">
                    <div class="col-md-6">
                        <label for="pipe_name" class="form-label">管网名称</label>
                        <input type="text" class="form-control" id="pipe_name" value="{{ pipe.name }}" readonly>
                    </div>
                    <div class="col-md-6">
                        <label for="maintenance_type" class="form-label">维护类型</label>
                        <select class="form-select" id="maintenance_type" name="maintenance_type" required>
                            <option value="check">检查</option>
                            <option value="repair">维修</option>
                            <option value="replace">更换</option>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label for="maintenance_date" class="form-label">维护时间</label>
                        <input type="datetime-local" class="form-control" id="maintenance_date" name="maintenance_date" required>
                    </div>
                    <div class="col-md-6">
                        <label for="operator" class="form-label">操作人员</label>
                        <input type="text" class="form-control" id="operator" name="operator" required>
                    </div>
                    <div class="col-md-12">
                        <label for="description" class="form-label">维护描述</label>
                        <textarea class="form-control" id="description" name="description" rows="3" required></textarea>
                    </div>
                    <div class="col-md-6">
                        <label for="status" class="form-label">维护状态</label>
                        <select class="form-select" id="status" name="status" required>
                            <option value="completed">已完成</option>
                            <option value="in_progress">进行中</option>
                        </select>
                    </div>
                    <div class="col-12">
                        <div class="d-flex justify-content-between">
                            <a href="{{ url_for('network.network_index') }}" class="btn btn-secondary">
                                <i class="fas fa-arrow-left me-1"></i>返回
                            </a>
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-save me-1"></i>保存
                            </button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %} 